/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MyIM.server.engine;

import MyIM.client.callback.CallBackRemote;
import MyIM.component.Friend;
import MyIM.component.Group;
import MyIM.utilities.Status;
import java.io.File;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;
import javax.swing.ImageIcon;

/**
 *
 * @author satthuvdh
 */
public interface ServerModel extends Remote {

    Status checkUserExists(String username) throws RemoteException;

    Status registering(String username, String password, String displayName, File avatar) throws RemoteException;

    Status login(String username, String password, CallBackRemote callback) throws RemoteException;

    void logout(int uid) throws RemoteException;

    Status addGroup(String groupName, int uid) throws RemoteException;

    Status addFriend(int uid, int fid, int gid) throws RemoteException;

    Status removeFriend(int uid, int fid) throws RemoteException;

    void sendMessage(int from, int to, String message) throws RemoteException;

    void changeGroup(int uid, int fid, int gid) throws RemoteException;

    void sendMessageConf(int ownerid, String confereceName, int from, ArrayList<Friend> to, String message) throws RemoteException;

    int getIdFromUsername(String username) throws RemoteException;

    String getDisplayName(String username) throws RemoteException;

    ImageIcon getAvatar(String username) throws RemoteException;

    ArrayList<Group> getFriendList(int uid) throws RemoteException;

    Status sendAddFriendRequest(int uid, int fid, int gids) throws RemoteException;

    int getGroupIdByName(String groupName, int uid) throws RemoteException;

    Group getGroupByName(String groupName, int uid) throws RemoteException;

    String getUsernameById(int id) throws RemoteException;

    Friend getFriend(int uid) throws RemoteException;

    void initUserInfomation(String username, CallBackRemote callback) throws RemoteException;

    CallBackRemote getCallBackRemoteById(int id) throws RemoteException;

    Status removeGroup(int uId, int groupId) throws RemoteException;

    Status renameGroup(int uid, int groupId, String text) throws RemoteException;

    Status moveFriend(int uid, int fid, int gid) throws RemoteException;

    Status inviteConference(int ownerid, String conferenceName, ArrayList<Friend> attendees, int uid) throws RemoteException;

    Status acceptAddFriend(int requested, int requester) throws RemoteException;

    void exitConference(int ownerid, String conferenceName, ArrayList<Friend> attendees) throws RemoteException;

    void changeDisplay(int uid, String displayName) throws RemoteException;

    void changeAvatar(int uid, File avatar) throws RemoteException;

    void changePassword(int uid, String password) throws RemoteException;

    String getPassword(int uid) throws RemoteException;
}
